<template>
    <div>
        <!-- 人氣推薦組件 -->
        <div  @click="goRecom">
        <wgytitle title='人气推荐'></wgytitle>
        </div>
        <wgyOneUpright :recommend='recommend' ></wgyOneUpright>
    </div>
</template>

<script>
import {getGoodsList} from '../../utils/api/Home'
import wgytitle from '../wgy-Title/wgy-Title'
import wgyOneUpright from '@/components/wgy-One-Upright/wgy-One-Upright'
export default {
    data() {
        return {
            recommend:[]
        };
    },
    created() {
        // 获取首页的4个数据
        getGoodsList().then(res => {
            this.recommend = res.data.splice(9,4)
        })
    },
    methods: {
        // 去人气推荐列表
        goRecom() {
            this.$router.push('/recommend')
        },
       
    },
    //组件挂载
    components: {
        wgytitle,
        wgyOneUpright,
    },
    //计算属性
    computed: {},
    //过滤器
    filters: {},
};
</script>

<style lang="scss" scoped>

</style>
